package es.lfp.spain;

import java.util.Vector;

/**
 * 
 * @author daniel_ancin
 *
 */
public class NationalTeam {
	private Vector<Player> Players= new Vector<Player>();
	
	
	/**
	 * Method to add cuestion vector
	 * @param p
	 */
	public void addPlayer(Player p) {
		Players.add(p);
				
	}

	/**
	 * Method delete player
	 * @param number
	 */
	public void delPlayer(int number) {
		for (int i = 0;i<Players.size();i++) {
			if (Players.elementAt(i) == Players.elementAt(number)){
				Players.remove(i);
			}
		}
		
	}

	/**
	 * Method search Position
	 * @param p
	 * @return
	 */
	public Vector searchByPos(String p) {
		Vector position = new Vector<Player>();
		for (int i=0; i<Players.size();i++){
			if (Players.elementAt(i).getPosition().equals(position)){
				position.add(i);
			}
		}
		return position;
	}

	/**
	 * Method to see all
	 * @return
	 */
	public String seeAll() {
		String PlayersInfo="";
		for(int i =0; i<Players.size();i++){
			PlayersInfo= PlayersInfo +Players.elementAt(i).toString();
		}
		return PlayersInfo;
	}
}
